package com.hb.core.enums;

import com.hb.core.constant.Code;

/**
 * @description:
 * @projectName: zhb-frame-build
 * @author: zhouhaizhi
 * @createTime: 2021/8/25 11:37
 * @version:1.0
 */
public enum CommCode implements Code {
    SUCCESS(COMM_BASE, "comm.success", "成功"),
    ERROR(COMM_BASE + 1, "comm.error", "系统错误"),
    UNKNOW(COMM_BASE + 2, "comm.unknow", "未知"),
    PARAM_ERROE(COMM_BASE + 3, "comm.param.error", "参数错误"),
    DATA_REPEAT(COMM_BASE + 4, "comm.data.repeat", "数据重复"),
    DATA_NOT_EXIST(COMM_BASE + 5, "comm.data.not.exist", "数据不存在"),
    DATA_ERROR(COMM_BASE + 6, "comm.data.error", "数据有误"),
    LOGIN_ERROR(COMM_BASE + 7, "comm.login.error", "登录失败"),
    THIRD_API_ERROR(COMM_BASE + 8, "comm.third.api.error", "请求远程服务失败");

    private Integer code;

    private String name;

    private String message;

    CommCode(Integer code, String name, String message) {
        this.code = code;
        this.name = name;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return null;
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public String getMessage() {
        return null;
    }

    public Code setMessage(String message){
        this.message = message;
         return this;
    }

    public String toString(){
        return String.valueOf(this.code);
    }
}
